package the.guanzhong.express.interfaces.controller.resp;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
public class ShopBetweenResp implements Serializable {
    private static final long serialVersionUID = -4043039878014758680L;

    private List<CargoInfo> cargo;

    /**
     * 线路名称
     */
    private String name;

    /**
     * 线路类型
     * 1短途拼车
     * 2专线直达
     */
    private Integer type;

    @Data
    public static class CargoInfo implements Serializable {
        private static final long serialVersionUID = -6028553141681702705L;

        private Integer type;

        /**
         * 送货上门费
         */
        private BigDecimal deliFee;
        /**
         * 保底价
         */
        private BigDecimal basePrice;
        private PromotionInfo promotion;
        private List<SpecInfo> spec;
        private Union union = new Union();
    }

    @Data
    public static class SpecInfo implements Serializable {
        private static final long serialVersionUID = -5175864283506963687L;

        private Integer id;
        private String name;
        private BigDecimal price;

        /**
         * 上门取件费
         */
        private BigDecimal takingFee;
        private PromotionInfo promotion;
    }

    @Data
    public static class PromotionInfo implements Serializable {
        private static final long serialVersionUID = 8303044460846028331L;

        public PromotionInfo() {
            this.onSale = false;
        }
        private Boolean onSale;

        /**
         * 折扣
         */
        private BigDecimal discount;

        /**
         * 满减金额
         */
        private BigDecimal reduction;

        /**
         * 门槛金额
         */
        private BigDecimal threshold = BigDecimal.ZERO;


        private String desc;

        /**
         * 1满折
         * 2满减
         */
        private Integer type;
    }

    @Data
    public static class Union implements Serializable {
        private static final long serialVersionUID = 1837797121815335731L;

        private Boolean on = false;
        private BigDecimal price = BigDecimal.ZERO;
    }
}
